#ifndef IMAGE_H
#define IMAGE_H

#include <QWidget>
#include <QImage>
#include <QVector>
#include <QList>

namespace Ui {
class image;
}

class image : public QWidget
{
    Q_OBJECT

public:
    explicit image(QWidget *parent = nullptr);
    ~image();
    void imageLoad(const QString path);
    void imageLoad(const QString path, int &_width, int &_height);

    uchar* imageData();

    void iamgeItems(int x, int y, QList<QImage> &imageList);
    void iamgeItems(int x, int y, QList<uchar*> &list);
    void iamgeItems(int x, int y, QVector<uchar*> & vector);

    void imageSave();
    void imageSave(int index);
    void imageSave(int start,int end);

    void imageShow();
    void imageShow(QList<QImage> &listImage);
    void imageShow(QList<uchar*> &listItems);
    void imageShow(QVector<uchar*> &VectorItems);
    static image* instance();
private:
    Ui::image *ui;
    QImage r_image;
    uchar * r_image_data;
    QList<QRect> _imageRects;
    QList<QImage> _imageList;
    QList<uchar*> _listItems;
    QVector<uchar*> _vectorItems;
};

#endif // IMAGE_H
